package com.huitu.whht.base.core.api.wrem.plan;

import com.huitu.api.rest.AbstractApiResource;
import com.huitu.commons.PageUtils;
import com.huitu.whht.api.core.common.response.ApiResultBuilder;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiResource;
import com.huitu.whht.api.core.common.annotations.SzyCoreApiService;
import com.huitu.whht.api.core.common.response.StatusRespBuilder;

import com.huitu.whht.base.core.api.wrem.plan.entities.WremPlanStepB;

import com.huitu.whht.base.core.api.wrem.plan.entities.WremPlanStepBQo;
import com.huitu.whht.base.core.api.wrem.plan.service.IWremPlanStepBService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * 说明: 应急事件调度方案处置细则基本信息表API,表名称: T_WHHT_WREM_PLAN_STEP_B <br/>
 * 日期: 2019-04-15
 * @author LiuCW
 */
@Component
@SzyCoreApiResource
@Path("generate/plan/step/b")
public class WremPlanStepBResource extends AbstractApiResource {

    private static final Logger LOGGER = LoggerFactory.getLogger(WremPlanStepBResource.class);

    private static final String UUID = "d52af8d1-6ff7-4c73-90a0-78ef6073ad11";

    @Override
    public String getUUID() {
        return UUID;
    }

    @Autowired
    @SzyCoreApiService
    IWremPlanStepBService wremPlanStepBService;

    /**
     * @api {get} generate/plan/step/b/{stepId} [R][G]根据主键查询
     * @apiDescription [G]根据主键查询T_WHHT_WREM_PLAN_STEP_B(应急事件调度方案处置细则基本信息表)数据
     * @apiName (generate)select by primary key
     * @apiGroup WREM_PLAN_STEP_B-应急事件调度方案处置细则基本信息表
     * @apiVersion 1.0.0
     * @apiSampleRequest generate/plan/step/b/8a717701-da1f-484f-93a4-c5ae9e17da9a
     * @apiParam   {String}         stepId             【必须】方案处置措施代码
     * @apiSuccess {String}         stepId             方案处置措施代码
     * @apiSuccess {String}         planId             方案代码
     * @apiSuccess {String}         stepTp             处置措施类型
     * @apiSuccess {String}         respPersonId       负责人ID
     * @apiSuccess {String}         respOrgNm          负责单位名称
     * @apiSuccess {Date}           stepBgTm           处置措施计划开始时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Date}           stepEdTm           处置措施计划结束时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Date}           stepActualBgTm     处置措施实际开始时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {Date}           stepActualEdTm     处置措施实际结束时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {String}         content            具体说明
     * @apiSuccess {String}         stepStatus         处置措施状态(0.未开始;1.进行中;2.已完成)
     * @apiSuccess {String}         summary            总结
     * @apiSuccess {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiSuccess {String}         stepTitle          标题
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "stepId": "8a717701-da1f-484f-93a4-c5ae9e17da9a",
     * "planId": "e741bcb8-2491-4573-9b12-449371c5e738",
     * "stepTp": null,
     * "respPersonId": "ff555a1a-621a-4128-bef4-6b31e46b37e3",
     * "respOrgNm": null,
     * "stepBgTm": "2018-12-17 18:15:45.0",
     * "stepEdTm": "2018-12-19 18:15:51.0",
     * "stepActualBgTm": null,
     * "stepActualEdTm": null,
     * "content": "oracle.sql.CLOB@17bd805",
     * "stepStatus": null,
     * "summary": null,
     * "ts": "2018-12-18 18:15:55.0",
     * "stepTitle": "12.18处置措施"
     *  }
     * }
     * @apiUse exceptions
     */
    @GET
    @Path("{stepId}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectByPrimaryKey(@PathParam("stepId") String stepId) {
        LOGGER.info("根据主键查询 应急事件调度方案处置细则基本信息表,参数 stepId:{}", stepId);
        return Response.ok(ApiResultBuilder.create(this, wremPlanStepBService.selectByPrimaryKey(stepId))).build();
    }

    /**
     * @api {post} generate/plan/step/b/list [R][G]根据条件查询
     * @apiDescription [G]根据条件查询T_WHHT_WREM_PLAN_STEP_B(应急事件调度方案处置细则基本信息表)数据
     * @apiName (generate)select by filter
     * @apiGroup WREM_PLAN_STEP_B-应急事件调度方案处置细则基本信息表
     * @apiVersion 1.0.0
     * @apiSampleRequest generate/plan/step/b/list
     * @apiParam   {List(String)}   stepIdList         (数组)方案处置措施代码
     * @apiParam   {String}         stepId             方案处置措施代码
     * @apiParam   {List(String)}   planIdList         (数组)方案代码
     * @apiParam   {String}         planId             方案代码
     * @apiParam   {List(String)}   stepTpList         (数组)处置措施类型
     * @apiParam   {List(String)}   respPersonIdList   (数组)负责人ID
     * @apiParam   {String}         respPersonId       负责人ID
     * @apiParam   {String}         respOrgNm          负责单位名称
     * @apiParam   {Date}           stepBgTmBgTm       (开始时间)处置措施计划开始时间
     * @apiParam   {Date}           stepBgTmEdTm       (结束时间)处置措施计划开始时间
     * @apiParam   {Date}           stepEdTmBgTm       (开始时间)处置措施计划结束时间
     * @apiParam   {Date}           stepEdTmEdTm       (结束时间)处置措施计划结束时间
     * @apiParam   {Date}           stepActualBgTmBgTm (开始时间)处置措施实际开始时间
     * @apiParam   {Date}           stepActualBgTmEdTm (结束时间)处置措施实际开始时间
     * @apiParam   {Date}           stepActualEdTmBgTm (开始时间)处置措施实际结束时间
     * @apiParam   {Date}           stepActualEdTmEdTm (结束时间)处置措施实际结束时间
     * @apiParam   {String}         content            具体说明
     * @apiParam   {List(String)}   stepStatusList     (数组)处置措施状态(0.未开始;1.进行中;2.已完成)
     * @apiParam   {String}         summary            总结
     * @apiParam   {Date}           tsBgTm             (开始时间)时间戳
     * @apiParam   {Date}           tsEdTm             (结束时间)时间戳
     * @apiParam   {String}         stepTitle          标题
     * @apiSuccess {String}         stepId             方案处置措施代码
     * @apiSuccess {String}         planId             方案代码
     * @apiSuccess {String}         stepTp             处置措施类型
     * @apiSuccess {String}         respPersonId       负责人ID
     * @apiSuccess {String}         respOrgNm          负责单位名称
     * @apiSuccess {Date}           stepBgTm           处置措施计划开始时间
     * @apiSuccess {Date}           stepEdTm           处置措施计划结束时间
     * @apiSuccess {Date}           stepActualBgTm     处置措施实际开始时间
     * @apiSuccess {Date}           stepActualEdTm     处置措施实际结束时间
     * @apiSuccess {String}         content            具体说明
     * @apiSuccess {String}         stepStatus         处置措施状态(0.未开始;1.进行中;2.已完成)
     * @apiSuccess {String}         summary            总结
     * @apiSuccess {Date}           ts                 时间戳
     * @apiSuccess {String}         stepTitle          标题
     * @apiSuccessExample 请求成功:
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "stepId": "8a717701-da1f-484f-93a4-c5ae9e17da9a",
     * "planId": "e741bcb8-2491-4573-9b12-449371c5e738",
     * "stepTp": null,
     * "respPersonId": "ff555a1a-621a-4128-bef4-6b31e46b37e3",
     * "respOrgNm": null,
     * "stepBgTm": "2018-12-17 18:15:45.0",
     * "stepEdTm": "2018-12-19 18:15:51.0",
     * "stepActualBgTm": null,
     * "stepActualEdTm": null,
     * "content": "oracle.sql.CLOB@17bd805",
     * "stepStatus": null,
     * "summary": null,
     * "ts": "2018-12-18 18:15:55.0",
     * "stepTitle": "12.18处置措施"
     *  }]
     * }
     *
     * @apiSuccessExample 分页请求:
     * request header: Rang={max=50;size=50;field=TS DESC}
     * HTTP/1.1 200 OK
     * {
     * "result": [{
     * "stepId": "8a717701-da1f-484f-93a4-c5ae9e17da9a",
     * "planId": "e741bcb8-2491-4573-9b12-449371c5e738",
     * "stepTp": null,
     * "respPersonId": "ff555a1a-621a-4128-bef4-6b31e46b37e3",
     * "respOrgNm": null,
     * "stepBgTm": "2018-12-17 18:15:45.0",
     * "stepEdTm": "2018-12-19 18:15:51.0",
     * "stepActualBgTm": null,
     * "stepActualEdTm": null,
     * "content": "oracle.sql.CLOB@17bd805",
     * "stepStatus": null,
     * "summary": null,
     * "ts": "2018-12-18 18:15:55.0",
     * "stepTitle": "12.18处置措施"
     *  }],
     * "paging": {
     * "count": 3,
     * "total": 120,
     * "finale": false,
     * "index": 1
     * }
     * }
     * @apiUse header_rang
     * @apiUse exceptions
     */
    @POST
    @Path("list")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response selectList(WremPlanStepBQo filter) {
        PageUtils.startPageFromRang();
        LOGGER.info("根据条件查询 应急事件调度方案处置细则基本信息表,参数 WremPlanStepBQo:{}", filter);
        return Response.ok(ApiResultBuilder.create(this, wremPlanStepBService.selectList(filter))).build();
    }

    /**
     * @api {put} generate/plan/step/b [C][G]新增数据
     * @apiPrivate
     * @apiDescription [G]新增T_WHHT_WREM_PLAN_STEP_B(应急事件调度方案处置细则基本信息表)数据
     * @apiName (generate)add data
     * @apiGroup WREM_PLAN_STEP_B-应急事件调度方案处置细则基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stepId             【必须】方案处置措施代码
     * @apiParam   {String}         planId             方案代码
     * @apiParam   {String}         stepTp             处置措施类型
     * @apiParam   {String}         respPersonId       负责人ID
     * @apiParam   {String}         respOrgNm          负责单位名称
     * @apiParam   {Date}           stepBgTm           处置措施计划开始时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           stepEdTm           处置措施计划结束时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           stepActualBgTm     处置措施实际开始时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           stepActualEdTm     处置措施实际结束时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         content            具体说明
     * @apiParam   {String}         stepStatus         处置措施状态(0.未开始;1.进行中;2.已完成)
     * @apiParam   {String}         summary            总结
     * @apiParam   {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         stepTitle          标题
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest generate/plan/step/b
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "stepId": "8a717701-da1f-484f-93a4-c5ae9e17da9a"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "stepId": "8a717701-da1f-484f-93a4-c5ae9e17da9a"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stepId": "8a717701-da1f-484f-93a4-c5ae9e17da9a",
     * "planId": "e741bcb8-2491-4573-9b12-449371c5e738",
     * "stepTp": null,
     * "respPersonId": "ff555a1a-621a-4128-bef4-6b31e46b37e3",
     * "respOrgNm": null,
     * "stepBgTm": "2018-12-17 18:15:45.0",
     * "stepEdTm": "2018-12-19 18:15:51.0",
     * "stepActualBgTm": null,
     * "stepActualEdTm": null,
     * "content": "oracle.sql.CLOB@17bd805",
     * "stepStatus": null,
     * "summary": null,
     * "ts": "2018-12-18 18:15:55.0",
     * "stepTitle": "12.18处置措施"
     * }
     * @apiUse exceptions
     */
    @PUT
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insert(WremPlanStepB record) {
        LOGGER.info("新增 应急事件调度方案处置细则基本信息表,参数 WremPlanStepB:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wremPlanStepBService.insertSelective(record),record))).build();
    }

    /**
     * @api {post} generate/plan/step/b/insertBatch [C][G]批量新增数据
     * @apiPrivate
     * @apiDescription [G]批量新增T_WHHT_WREM_PLAN_STEP_B(应急事件调度方案处置细则基本信息表)数据
     * @apiName (generate)addBatch data
     * @apiGroup WREM_PLAN_STEP_B-应急事件调度方案处置细则基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stepId             【必须】方案处置措施代码
     * @apiParam   {String}         planId             方案代码
     * @apiParam   {String}         stepTp             处置措施类型
     * @apiParam   {String}         respPersonId       负责人ID
     * @apiParam   {String}         respOrgNm          负责单位名称
     * @apiParam   {Date}           stepBgTm           处置措施计划开始时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           stepEdTm           处置措施计划结束时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           stepActualBgTm     处置措施实际开始时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {Date}           stepActualEdTm     处置措施实际结束时间(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         content            具体说明
     * @apiParam   {String}         stepStatus         处置措施状态(0.未开始;1.进行中;2.已完成)
     * @apiParam   {String}         summary            总结
     * @apiParam   {Date}           ts                 时间戳(时间格式 <font color='red'>yyyy-MM-dd HH:mm:ss</font>)
     * @apiParam   {String}         stepTitle          标题
     * @apiSuccess {Integer}        status             1:新增成功;0:新增失败.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据,通常包含新增数据的主键值
     * @apiSampleRequest generate/plan/step/b/insertBatch
     * @apiSuccessExample 新增成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":{
     *   "stepId": "8a717701-da1f-484f-93a4-c5ae9e17da9a"
     *      }
     *   }
     * }
     @apiSuccessExample 新增失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":{
     *   "stepId": "8a717701-da1f-484f-93a4-c5ae9e17da9a"
     *      }
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "stepId": "8a717701-da1f-484f-93a4-c5ae9e17da9a",
     * "planId": "e741bcb8-2491-4573-9b12-449371c5e738",
     * "stepTp": null,
     * "respPersonId": "ff555a1a-621a-4128-bef4-6b31e46b37e3",
     * "respOrgNm": null,
     * "stepBgTm": "2018-12-17 18:15:45.0",
     * "stepEdTm": "2018-12-19 18:15:51.0",
     * "stepActualBgTm": null,
     * "stepActualEdTm": null,
     * "content": "oracle.sql.CLOB@17bd805",
     * "stepStatus": null,
     * "summary": null,
     * "ts": "2018-12-18 18:15:55.0",
     * "stepTitle": "12.18处置措施"
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("insertBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insertBatch(List<WremPlanStepB> recordList) {
        LOGGER.info("批量新增 应急事件调度方案处置细则基本信息表,参数 WremPlanStepB:[]", recordList);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.insert(wremPlanStepBService.insertBatch(recordList),recordList))).build();
    }

    /**
     * @api {put} generate/plan/step/b/{stepId}/update [U][G]根据主键修改
     * @apiPrivate
     * @apiDescription [G]根据主键修改T_WHHT_WREM_PLAN_STEP_B(应急事件调度方案处置细则基本信息表)数据
     * @apiName (generate)update data
     * @apiGroup WREM_PLAN_STEP_B-应急事件调度方案处置细则基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stepId             【必须】方案处置措施代码
     * @apiParam   {String}         planId             方案代码
     * @apiParam   {String}         stepTp             处置措施类型
     * @apiParam   {String}         respPersonId       负责人ID
     * @apiParam   {String}         respOrgNm          负责单位名称
     * @apiParam   {Date}           stepBgTm           处置措施计划开始时间
     * @apiParam   {Date}           stepEdTm           处置措施计划结束时间
     * @apiParam   {Date}           stepActualBgTm     处置措施实际开始时间
     * @apiParam   {Date}           stepActualEdTm     处置措施实际结束时间
     * @apiParam   {String}         content            具体说明
     * @apiParam   {String}         stepStatus         处置措施状态(0.未开始;1.进行中;2.已完成)
     * @apiParam   {String}         summary            总结
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {String}         stepTitle          标题
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest generate/plan/step/b/8a717701-da1f-484f-93a4-c5ae9e17da9a/update
     * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stepId": "8a717701-da1f-484f-93a4-c5ae9e17da9a",
     * "planId": "e741bcb8-2491-4573-9b12-449371c5e738",
     * "stepTp": null,
     * "respPersonId": "ff555a1a-621a-4128-bef4-6b31e46b37e3",
     * "respOrgNm": null,
     * "stepBgTm": "2018-12-17 18:15:45.0",
     * "stepEdTm": "2018-12-19 18:15:51.0",
     * "stepActualBgTm": null,
     * "stepActualEdTm": null,
     * "content": "oracle.sql.CLOB@17bd805",
     * "stepStatus": null,
     * "summary": null,
     * "ts": "2018-12-18 18:15:55.0",
     * "stepTitle": "12.18处置措施"
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{stepId}/update")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response update(@PathParam("stepId") String stepId, WremPlanStepB record) {
        record.setStepId(stepId);
        LOGGER.info("根据主键修改 应急事件调度方案处置细则基本信息表,参数 WremPlanStepB:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wremPlanStepBService.updateByPrimaryKey(record)))).build();
    }

    /**
     * @api {put} generate/plan/step/b/{stepId}/update-selective [U][G]根据主键修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据主键修改T_WHHT_WREM_PLAN_STEP_B(应急事件调度方案处置细则基本信息表)数据,只修改非null字段
     * @apiName (generate)update selected data
     * @apiGroup WREM_PLAN_STEP_B-应急事件调度方案处置细则基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stepId             方案处置措施代码
     * @apiParam   {String}         planId             方案代码
     * @apiParam   {String}         stepTp             处置措施类型
     * @apiParam   {String}         respPersonId       负责人ID
     * @apiParam   {String}         respOrgNm          负责单位名称
     * @apiParam   {Date}           stepBgTm           处置措施计划开始时间
     * @apiParam   {Date}           stepEdTm           处置措施计划结束时间
     * @apiParam   {Date}           stepActualBgTm     处置措施实际开始时间
     * @apiParam   {Date}           stepActualEdTm     处置措施实际结束时间
     * @apiParam   {String}         content            具体说明
     * @apiParam   {String}         stepStatus         处置措施状态(0.未开始;1.进行中;2.已完成)
     * @apiParam   {String}         summary            总结
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {String}         stepTitle          标题
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest generate/plan/step/b/8a717701-da1f-484f-93a4-c5ae9e17da9a/update-selective
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * {
     * "stepId": "8a717701-da1f-484f-93a4-c5ae9e17da9a",
     * "planId": "e741bcb8-2491-4573-9b12-449371c5e738",
     * "stepTp": null,
     * "respPersonId": "ff555a1a-621a-4128-bef4-6b31e46b37e3",
     * "respOrgNm": null,
     * "stepBgTm": "2018-12-17 18:15:45.0",
     * "stepEdTm": "2018-12-19 18:15:51.0",
     * "stepActualBgTm": null,
     * "stepActualEdTm": null,
     * "content": "oracle.sql.CLOB@17bd805",
     * "stepStatus": null,
     * "summary": null,
     * "ts": "2018-12-18 18:15:55.0",
     * "stepTitle": "12.18处置措施"
     * }
     * @apiUse exceptions
     */
    @PUT
    @Path("{stepId}/update-selective")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateSelective(@PathParam("stepId") String stepId, WremPlanStepB record) {
        record.setStepId(stepId);
        LOGGER.info("根据主键修改(只修改非null字段) 应急事件调度方案处置细则基本信息表,参数 WremPlanStepB:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wremPlanStepBService.updateByPrimaryKeySelective(record)))).build();
    }

    /**
     * @api {post} generate/plan/step/b/updateBatch [U][G]根据主键批量修改(只修改非null字段)
     * @apiPrivate
     * @apiDescription [G]根据批量主键修改T_WHHT_WREM_PLAN_STEP_B(应急事件调度方案处置细则基本信息表)数据,只修改非null字段
     * @apiName (generate)updateBatch selected data
     * @apiGroup WREM_PLAN_STEP_B-应急事件调度方案处置细则基本信息表
     * @apiVersion 1.0.0
     * @apiParam   {String}         stepId             方案处置措施代码
     * @apiParam   {String}         planId             方案代码
     * @apiParam   {String}         stepTp             处置措施类型
     * @apiParam   {String}         respPersonId       负责人ID
     * @apiParam   {String}         respOrgNm          负责单位名称
     * @apiParam   {Date}           stepBgTm           处置措施计划开始时间
     * @apiParam   {Date}           stepEdTm           处置措施计划结束时间
     * @apiParam   {Date}           stepActualBgTm     处置措施实际开始时间
     * @apiParam   {Date}           stepActualEdTm     处置措施实际结束时间
     * @apiParam   {String}         content            具体说明
     * @apiParam   {String}         stepStatus         处置措施状态(0.未开始;1.进行中;2.已完成)
     * @apiParam   {String}         summary            总结
     * @apiParam   {Date}           ts                 时间戳
     * @apiParam   {String}         stepTitle          标题
     * @apiSuccess {Integer}        status             1:修改成功;0:要修改的数据不存在(可能已被删除)
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSampleRequest  generate/plan/step/b/updateBatch
     * * @apiSuccessExample 修改成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 修改失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiParamExample {json} 请求示例:
     * [{
     * "stepId": "8a717701-da1f-484f-93a4-c5ae9e17da9a",
     * "planId": "e741bcb8-2491-4573-9b12-449371c5e738",
     * "stepTp": null,
     * "respPersonId": "ff555a1a-621a-4128-bef4-6b31e46b37e3",
     * "respOrgNm": null,
     * "stepBgTm": "2018-12-17 18:15:45.0",
     * "stepEdTm": "2018-12-19 18:15:51.0",
     * "stepActualBgTm": null,
     * "stepActualEdTm": null,
     * "content": "oracle.sql.CLOB@17bd805",
     * "stepStatus": null,
     * "summary": null,
     * "ts": "2018-12-18 18:15:55.0",
     * "stepTitle": "12.18处置措施"
     * }]
     * @apiUse exceptions
     */
    @POST
    @Path("updateBatch")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response updateBatch(List<WremPlanStepB> record) {
        LOGGER.info("根据主键批量修改(只修改非null字段) 应急事件调度方案处置细则基本信息表,参数 WremPlanStepB:{}", record);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.update(wremPlanStepBService.updateBatch(record)))).build();
    }

    /**
     * @api {delete} generate/plan/step/b/{stepId} [D][G]根据主键删除
     * @apiPrivate
     * @apiDescription [G]根据主键删除T_WHHT_WREM_PLAN_STEP_B(应急事件调度方案处置细则基本信息表)数据
     * @apiName (generate)delete by primary key
     * @apiGroup WREM_PLAN_STEP_B-应急事件调度方案处置细则基本信息表
     * @apiVersion 1.0.0
     * @apiSampleRequest generate/plan/step/b/8a717701-da1f-484f-93a4-c5ae9e17da9a
     * @apiParam   {String}         stepId             【必须】方案处置措施代码
     * @apiSuccess {Integer}        status             1:删除成功;0:要删除的数据不存在(可能已被删除).
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("{stepId}")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response delete(@PathParam("stepId") String stepId) {
        LOGGER.info("根据主键删除 应急事件调度方案处置细则基本信息表,参数 stepId:{}", stepId);
        Integer rows = wremPlanStepBService.deleteByPrimaryKey(stepId);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }

    /**
     * @api {delete} generate/plan/step/b/by-filter [D][G]根据条件删除
     * @apiPrivate
     * @apiDescription [G]根据条件删除T_WHHT_WREM_PLAN_STEP_B(应急事件调度方案处置细则基本信息表)数据
     * @apiName (generate)delete by filter
     * @apiGroup WREM_PLAN_STEP_B-应急事件调度方案处置细则基本信息表
     * @apiVersion 1.0.0
     * @apiSampleRequest generate/plan/step/b/by-filter
     * @apiParam   {List(String)}   stepIdList         (数组)方案处置措施代码
     * @apiParam   {String}         stepId             方案处置措施代码
     * @apiParam   {List(String)}   planIdList         (数组)方案代码
     * @apiParam   {String}         planId             方案代码
     * @apiParam   {List(String)}   stepTpList         (数组)处置措施类型
     * @apiParam   {List(String)}   respPersonIdList   (数组)负责人ID
     * @apiParam   {String}         respPersonId       负责人ID
     * @apiParam   {String}         respOrgNm          负责单位名称
     * @apiParam   {Date}           stepBgTmBgTm       (开始时间)处置措施计划开始时间
     * @apiParam   {Date}           stepBgTmEdTm       (结束时间)处置措施计划开始时间
     * @apiParam   {Date}           stepEdTmBgTm       (开始时间)处置措施计划结束时间
     * @apiParam   {Date}           stepEdTmEdTm       (结束时间)处置措施计划结束时间
     * @apiParam   {Date}           stepActualBgTmBgTm (开始时间)处置措施实际开始时间
     * @apiParam   {Date}           stepActualBgTmEdTm (结束时间)处置措施实际开始时间
     * @apiParam   {Date}           stepActualEdTmBgTm (开始时间)处置措施实际结束时间
     * @apiParam   {Date}           stepActualEdTmEdTm (结束时间)处置措施实际结束时间
     * @apiParam   {String}         content            具体说明
     * @apiParam   {List(String)}   stepStatusList     (数组)处置措施状态(0.未开始;1.进行中;2.已完成)
     * @apiParam   {String}         summary            总结
     * @apiParam   {Date}           tsBgTm             (开始时间)时间戳
     * @apiParam   {Date}           tsEdTm             (结束时间)时间戳
     * @apiParam   {String}         stepTitle          标题
     * @apiSuccess {Integer}        status             通常1或者>1:删除成功;0:没有符合条件的数据.
     * @apiSuccess {String}         message            成功/失败消息内容
     * @apiSuccess {Object}         data               额外返回的数据
     * @apiSuccessExample 删除成功:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":1,
     * "message":"成功",
     * "data":null
     *   }
     * }
     * @apiSuccessExample 删除失败:
     * HTTP/1.1 200 OK
     * {
     * "result": {
     * "status":0,
     * "message":"失败",
     * "data":null
     *   }
     * }
     * @apiUse exceptions
     */
    @DELETE
    @Path("by-filter")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response deleteByFilter(WremPlanStepBQo filter) {
        LOGGER.info("根据条件删除 应急事件调度方案处置细则基本信息表,参数 WremPlanStepBQo:{}", filter);
        Integer rows = wremPlanStepBService.deleteByFilter(filter);
        return Response.ok(ApiResultBuilder.create(this, StatusRespBuilder.delete(rows))).build();
    }
}
